import request from '@/utils/request'

// 获取系统设置
export function getSettings() {
  return request({
    url: '/settings',
    method: 'get'
  })
}

// 更新系统设置
export function updateSettings(data) {
  return request({
    url: '/settings',
    method: 'put',
    data
  })
}

// 获取系统状态
export function getSystemStatus() {
  return request({
    url: '/settings/status',
    method: 'get'
  })
}

// 备份数据
export function backupData() {
  return request({
    url: '/settings/backup',
    method: 'post',
    responseType: 'blob'
  })
}

// 恢复数据
export function restoreData(file) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: '/settings/restore',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
} 